import { ref, effect } from '../packages/reactivity/src/index';

// const obj = ref({
//   name: 'Vue源码学习',
// });

const obj = ref('Vue源码学习');
// 调用 effect 方法
effect(() => {
  // (document.querySelector('#app') as HTMLElement).innerText = obj.value.name;
  (document.querySelector('#app') as HTMLElement).innerText = obj.value;
});

setTimeout(() => {
  obj.value = 'ref数据变化';
  // obj.value.name = 'ref数据变化';
}, 2000);

